package com.mpm.ai.controller;


import com.mpm.ai.data.Order;
import com.mpm.ai.services.OrderService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@CrossOrigin
public class OrderController {

	private final OrderService orderService;

	public OrderController(OrderService orderService) {
		this.orderService = orderService;
	}
	@CrossOrigin
	@GetMapping(value = "/order/list")
	public List<Order> getOrders() {
		return orderService.getOrders();
	}

}
